/*
 * @Description:
 * @Version: 2.0
 * @Autor: 许国辉
 * @Date: 2022-11-27 13:58:46
 * @LastEditors: 许国辉
 * @LastEditTime: 2023-05-15 16:24:28
 */
import { defHttp } from '/@/utils/http/axios';
import { OrderAir, OrderAirParams } from './model/airItineraryModel';
import { AirOrder } from './model/AirOrderModel';
import { RefundAirOrder } from './model/RefundAirOrderModel';
enum Api {
  getFlightTicketOrderByParams = '/journeyInfo/getFlightTicketOrderByParams',
  getTicketInfoByOrderNo = '/journeyInfo/getFlightTicketOrderDetailByParams',
  getFlightTicketRefundOrderDetailByOrderNum = '/journeyInfo/getFlightTicketRefundOrderDetailByOrderNum',
}
export function getFlightTicketOrderByParams(params: OrderAirParams) {
  params.orderNature = 0;
  return defHttp.post<OrderAir>({
    url: Api.getFlightTicketOrderByParams,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}

export function getFlightTicketOrderByParams1(params: OrderAirParams) {
  params.orderNature = 1;
  return defHttp.post<OrderAir>({
    url: Api.getFlightTicketOrderByParams,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
export function getFlightTicketOrderByParams2(params: OrderAirParams) {
  params.orderNature = 2;
  return defHttp.post<OrderAir>({
    url: Api.getFlightTicketOrderByParams,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
export function getTicketInfoByOrderNo(airOrderId: number) {
  return defHttp.post<AirOrder>({
    url: Api.getTicketInfoByOrderNo,
    params: { airOrderId: airOrderId },
    headers: { ignoreCancelToken: true },
  });
}

export function getFlightTicketOrderByParamsByChangeOldOrderId(ChangeOldOrderId: string) {
  return defHttp.post<OrderAir>({
    url: Api.getFlightTicketOrderByParams,
    params: { airOrderId: ChangeOldOrderId },
    headers: { ignoreCancelToken: true },
  });
}
export function getFlightTicketRefundOrderDetailByOrderNumByairOrderNum(airOrderNum: string) {
  return defHttp.post<RefundAirOrder[]>({
    url: Api.getFlightTicketRefundOrderDetailByOrderNum,
    params: { airOrderNum: airOrderNum },
    headers: { ignoreCancelToken: true },
  });
}
